package com.bjfu.eduservice.client;

import com.bjfu.common_utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-vod",fallback = VodFileDegradeFeignClient.class)
@Component
// @PathVariable必须制定参数名称，否则会出问题！！
public interface VodClient {
    // 定义调用的方法路径
    // 根据视频id删除阿里云视频
    // @PathVariable注解一定要指定参数名称，否则出错
    @DeleteMapping("/eduvod/video/deleteAlyiVideo/{id}")
    public R deleteVideo(@PathVariable(value = "id") String id);

    // 定义调用的方法路径
    // 删除多个阿里云视频
    // 参数是多个视频的id
    @DeleteMapping("/eduvod/video/deleteBatch")
    public R deleteBatch(@RequestParam List<String> videoList);
}
